package com.docker.sys.user;

import com.docker.core.constant.MainConstant;
import com.docker.core.mvc.dao.BaseDao;
import com.jfinal.plugin.activerecord.Record;

/**
 * @Author ldl
 * @Create 2020/09/17 017 09:56
 */
public class InsideUserDao extends BaseDao {

    @Override
    protected String getDbName() {
        return MainConstant.DB_DOCKER;
    }

    @Override
    protected String getSqlTplNameSpace() {
        return "sys.user.inside";
    }

    public boolean save(Record user) {
        return save("sys_user_inside", "user_id", user);
    }

    public boolean exist(String userId, String userPhone) {
        return tplQueryInt("exist", userId, userPhone) > 0;
    }

    public Record info(String userId) {
        return info("sys_user_inside", "user_id", userId);
    }

    public boolean update(Record user) {
        return update("sys_user_inside", "user_id", user);
    }

}
